home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6736 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: blv-pm3-ip24.halcyon.com!user
  2. From: hawkfish@punchdeck.com (Richard Wesley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: String Class in native Mac format (ANNOUNCEMENT)
  5. Date: Thu, 08 Feb 1996 06:58:28 -0800
  6. Organization: Punch Deck Consulting
  7. Message-ID: <hawkfish-0802960658280001@blv-pm3-ip24.halcyon.com>
  8. References: <Pine.SGI.3.91.960206075520.12266D-100000@golgi>
  9. NNTP-Posting-Host: blv-pm3-ip24.halcyon.com
  10. X-Newsreader: Yet Another NewsWatcher 2.1.2
  11.  
  12. In article <Pine.SGI.3.91.960206075520.12266D-100000@golgi>, Joseph Strout
  13. <jstrout@ucsd.edu> wrote:
  14.  
  15. >I have a String class whose internal data format is a Str255 
  16. >(255-character Pascal string), the format used by the Macintosh Toolbox.  
  17. >This means that you can pass my String directly to any Toolbox routine 
  18. >which expects a string, either for reading OR writing.
  19. >
  20. >This solves what is generally a major headache when using the Toolbox 
  21. >from C/C++, i.e. conversion of various string formats.
  22. >
  23. >The class supports all the standard operators ( +, [], ==, etc.) plus a 
  24. >number of other handy operators and functions, such as * (repeat), 
  25. >Element (gets a specified element, separated by a delimiter), Uppercase 
  26. >(obvious), and Plural (pluralizes most English words correctly).
  27. >
  28. >Although the internal format is especially handy on the Mac, I use the
  29. >same class (without modification) on other platforms (including Unix/g++
  30. >and DOS/Borland C++).  The Mac-specific code (mainly the conversion
  31. >to/from Str255) is separated from the generic code in "#ifdef macintosh"
  32. >blocks.
  33. >
  34. >The code and documentation are available via the WWW at:
  35. >        http://www-ncmir.ucsd.edu/~jstrout/classlib/
  36. >
  37. >The class may be used in any product, free of charge -- just slip my name 
  38. >into the credits somewhere, and kindly tell me about it.
  39.  
  40. I have a template that will do this for any size of Mac string object. 
  41. Not up on a site yet, as it is a part of a larger library still under
  42. development, but email me if you are interested.  Mine is not explicitly
  43. cross-platform, but allows construction of temporaries loaded from STR#
  44. resources (a very use type of expression in Mac programming).
  45.  
  46. Incidentally, PowerPlant comes with a similar template.
  47.  
  48.  
  49. - rmgw
  50.  
  51. http://www.punchdeck.com/hawkfish/PunchDeck.html
  52.  
  53. ----------------------------------------------------------------------------
  54. Richard Wesley             | "I don't know about your dreams
  55. hawkfish@punchdeck.com     |  But mine are sort of hackneyed"
  56. hawkfish@electricfish.com  |   - Laurie Anderson, "Talk Normal"
  57. ----------------------------------------------------------------------------
  58.